<!--
To change this license header, choose License Headers in Project Properties.
To change this template file, choose Tools | Templates
and open the template in the editor.
-->
        <script type="text/javascript">
            function check_nicheng(nc)
            {
              window.open("checknicheng.php?nicheng="+nc,"newframe","width=210,height=120,left=500,top=200,menubar=no,toolbar=no,location=no,scrollbars=no,location=no");
            }
            function check_input1(form1)
            {
              if(form1.username.value=="")
                  {
                   alert("请输入昵称!");
                   form1.username.select();
                   return(false);
                  }
                  if(form1.password1.value=="")
                  {
                   alert("请输入密码!");
                   form1.password1.select();
                   return(false);
                  }
              if(form1.password2.value=="")
                  {
                   alert("请输入确认密码!");
                   form1.password2.select();
                   return(false);
                   }	
                   /*
                  if(form.p1.value.length<6)
                   {
                   alert("注册密码长度应大于6!");
                   form.p1.select();
                   return(false);
                   }
                   */
                  if(form1.password1.value!=form1.password2.value)
                   {
                   alert("密码与确认密码不同!");
                   form1.password1.select();
                   return(false);
                   }
             if(form1.sex.value=="0")
                  {
                   alert("请选择性别!");
                   return(false);
                   }
             if(form1.age.value=="")
                  {
                   alert("请输入年龄!");
                   form1.age.select();
                   return(false);
                   }
            if(form1.tel.value=="")
                  {
                   alert("请输入联系方式!");
                   form1.tel.select();
                   return(false);
                   }
            if(form1.reserved_info.value=="")
                  {
                   alert("请输入预留信息!");
                   form1.reserved_info.select();
                   return(false);
                   }
             return(true);
            }
        </script>
        <?php
        // put your code here
        include ("top.php")
        /**
         * @todo 数据插入数据库时对非必填信息的检查
         */
        ?>
<table width="768" height="500" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td width="229" height="350" align="center" valign="top" bgcolor="#F5F5F5"><?php include("left.php");?></td>
    <td width="561" valign="top" bgcolor="#FFFFFF"><table width="557"  height="15" align="center" cellpadding="0" cellspacing="0">
      <tr>
        <td>&nbsp;</td>
      </tr>
      <tr>
        <td width="500"><table width="500" border="0" align="center" cellpadding="0" cellspacing="0">
            <tr>
              <td  bgcolor="#B0E0E6"><table width="500" border="0" align="center" cellpadding="0" cellspacing="1">
                  <form name="form1" method="post" action="savenewmembers.php" onSubmit="return check_input1(this)">
                    <tr>
                        <td colspan="2" align="center" bgcolor="#B0E0E6">
                            新用户注册
                        </td>
                    </tr>
                    <tr>
                      <td width="200" height="20" bgcolor="#FFFFFF"><div align="center">用户昵称：</div></td>
                      <td width="400" bgcolor="#FFFFFF"><div align="left">
                          <input type="text" name="username" size="25" maxlength="20" placeholder="字母和数字组成，不超过15位">
                          <span style="color: #FF0000">*</span>
                          <input name="button2" type="button" onclick="check_nicheng(form1.username.value)" value="查看昵称是否已用">
                      </div></td>
                    </tr>
                    <tr>
                      <td height="20" bgcolor="#FFFFFF"><div align="center">注册密码：</div></td>
                      <td height="20" bgcolor="#FFFFFF"><div align="left">
                          <input type="password" name="password1" size="25" maxlength="18" placeholder="字母和数字组成，8-16位">
                          <span style="color: #FF0000">*</span></div></td>
                    </tr>
                    <tr>
                      <td height="20" bgcolor="#FFFFFF"><div align="center">确认密码：</div></td>
                      <td height="20" bgcolor="#FFFFFF"><div align="left">
                          <input type="password" name="password2" size="25" maxlength="18" placeholder="请再输入一次密码">
                          <span style="color: #FF0000">*</span></div></td>
                    </tr>
                    <tr>
                      <td height="20" bgcolor="#FFFFFF"><div align="center">性别：</div></td>
                      <td height="20" bgcolor="#FFFFFF"><div align="left">
                              <?php
                                /**
                                 * @todo 改成用单选按钮
                                 */
                              ?>
                              <select name="sex">
                                  <option name="0" value="0">请选择</option>
                                  <option name="1" value="1">男</option>
                                  <option name="2" value="2">女</option>
                              </select>
                    </tr>
                    <tr>
                      <td height="20" bgcolor="#FFFFFF"><div align="center">年龄：</div></td>
                      <td height="20" bgcolor="#FFFFFF"><div align="left">
                              <input type="number" name="age" size="5" min="1" max="100">
                      </div></td>
                    </tr>
                    <tr>
                      <td height="20" bgcolor="#FFFFFF"><div align="center">联系方式(手机)：</div></td>
                      <td height="20" bgcolor="#FFFFFF"><div align="left">
                              <input type="tel" name="tel" size="25" maxlength="11" placeholder="8位座机号或11位手机号">
                    </tr>
                    <tr>
                      <td height="20" bgcolor="#FFFFFF"><div align="center">预留信息：</div></td>
                      <td height="20" bgcolor="#FFFFFF"><div align="left">
                          <input type="text" name="reserved_info" size="25" maxlength="20" placeholder="找回密码时用，不超过10位">
                          <span style="color: #FF0000">*</span></div></td>
                    </tr>
                    <tr>
                      <td height="20" colspan="2" bgcolor="#FFFFFF"><div align="center">
                          <input name="submit2" type="submit" value="提交">
                          <input name="reset" type="reset" value="重写">
                      </div></td>
                    </tr>
                  </form>
              </table></td>
            </tr>
          </table>
            <table width="557" height="25" border="0" align="center" cellpadding="0" cellspacing="0">
              <tr>
                <td width="547"><div align="center" style="color: #FF0000">注意：带*为必添内容!</div></td>
              </tr>
          </table></td>
      </tr>
    </table></td>
  </tr>
</table>
<?php
 include("bottom.php");
?>